program mmm;
{$APPTYPE CONSOLE}

var
  n, k, x, maxi, maxn: Integer;
  i, m: longint;
  oldVotes: array[1..100000] of Integer;
  nonExisting: array[1..100000] of Integer;
begin
  readln(n, m, k);
  for i := 1 to m do begin
    oldVotes[i] := 0;
  end;
  for i := 1 to n do begin
    read(x);
    Inc(oldVotes[x]);
  end;
  for i := 1 to k do begin
    read(x);
    oldVotes[x] := 0;
  end;
  maxn := 0;
  for i := 1 to m do begin
    if oldVotes[i] > maxn then begin
      maxn := oldVotes[i];
      maxi := i;
    end;
  end;
  writeln(maxi);
end.
